package cn.bugstack.middleware.dynamic.thread.pool.sdk.alarm.impl;

import cn.bugstack.middleware.dynamic.thread.pool.sdk.alarm.IAlarmNotifier;
import cn.bugstack.middleware.dynamic.thread.pool.sdk.domain.model.entity.ThreadPoolAlarmEntity;
import cn.bugstack.middleware.dynamic.thread.pool.sdk.domain.model.entity.ThreadPoolConfigEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @description 默认告警通知实现
 */
public class DefaultAlarmNotifier implements IAlarmNotifier {

    private final Logger logger = LoggerFactory.getLogger(DefaultAlarmNotifier.class);

    @Override
    public void notify(ThreadPoolConfigEntity threadPoolConfig, ThreadPoolAlarmEntity alarmConfig, String alarmMessage) {
        // 默认实现只记录日志，实际项目中可以扩展为发送邮件、短信等
        logger.warn("线程池告警通知 - 应用：{}，线程池：{}，接收人：{}，告警信息：{}", 
                threadPoolConfig.getAppName(), 
                threadPoolConfig.getThreadPoolName(),
                alarmConfig.getReceivers(),
                alarmMessage);
    }
}